package cn.zjyj.module.zjyj.dal.mysql.riskidentifyinstance;

import java.util.*;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.riskidentifyinstance.RiskIdentifyDeviceInstanceBo;
import cn.zjyj.module.zjyj.dal.dataobject.riskidentifyinstance.RiskIdentifyInstanceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.riskidentifyinstance.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 风险辨识实例 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RiskIdentifyInstanceMapper extends BaseMapperX<RiskIdentifyInstanceDO> {

    default PageResult<RiskIdentifyInstanceDO> selectPage(RiskIdentifyInstancePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskIdentifyInstanceDO>()
                .betweenIfPresent(RiskIdentifyInstanceDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RiskIdentifyInstanceDO::getIdentifyId, reqVO.getIdentifyId())
                .eqIfPresent(RiskIdentifyInstanceDO::getInstanceId, reqVO.getInstanceId())
                .eqIfPresent(RiskIdentifyInstanceDO::getStatus, reqVO.getStatus())
                .orderByDesc(RiskIdentifyInstanceDO::getId));
    }

    List<RiskIdentifyDeviceInstanceBo> getDeviceInstanceIdentify(@Param(value="ids") List<Long> ids);
}